package com.example.demo.io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;

/**
 * @ClassName TestTransform1
 * @Description TODO
 * @Author hly
 * @Date 2018\11\27 0027 14:21
 */
public class TestTransform1 {

    public static void main(String[] args) {
        try {
            OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("C:\\ss.txt"));
            osw.write("hlylalala");
            System.out.println(osw.getEncoding());
            osw.close();

            osw = new OutputStreamWriter(new FileOutputStream("C:\\ss.txt", true), "ISO8859_1");
            osw.write("dxllalalal");
            System.out.println(osw.getEncoding());
            osw.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
